# Maintainer: kpcyrd <git@rxv.cc>
pkgname=cargo-tarpaulin
pkgver=0.27.3
pkgrel=0
pkgdesc="Code coverage tool for Rust projects"
url="https://github.com/xd009642/tarpaulin"
arch="all !x86" # build fails on x86: https://github.com/xd009642/tarpaulin/issues/1468
license="Apache-2.0 OR MIT"
depends="cargo"
makedepends="
	cargo-auditable
	openssl-dev
	"
source="https://github.com/xd009642/tarpaulin/archive/refs/tags/$pkgver/cargo-tarpaulin-$pkgver.tar.gz"
builddir="$srcdir/tarpaulin-$pkgver"
options="net !check" # tests broken

export LIBSSH2_SYS_USE_PKG_CONFIG=1

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen -- \
		--skip git_info_correct \
		--skip kill_used_in_test \
		--skip llvm_sanity_test \
		--skip picking_up_shared_objects \
		--skip rustflags_handling
}

package() {
	install -Dm755 target/release/cargo-tarpaulin \
		-t "$pkgdir"/usr/bin
}

sha512sums="
aa577a91deffda0d5081b3b3fd20909caa512c8ce9915d8e20fb06f228e0507aae657dcab904cd00234d6b9fd74f7d45c624e220f4ec4ef7a2c94259d619b6d9  cargo-tarpaulin-0.27.3.tar.gz
"
